<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery.min.js"></script>
    <style>
      *{
        margin: 0;
        padding: 0;
      }  
      div {
          /* display: none; */
          width: 100px;
          height: 100px;
          background-color: pink;
          margin: 100px auto;
      }
    </style>
</head>
<body>
    <button class="b1">1</button>
    <button class="b2">2</button>
    <button class="b3">2</button>
    <button class="b4">4</button>
    <div></div>
    <script>
        $(function(){
            $(".b1").click(function(){
                $("div").fadeIn(1000)
            })
            $(".b2").click(function(){
                $("div").fadeOut(1000)
            })
            $(".b4").click(function(){
                $("div").fadeTo(1000,0.5)
            })
            $(".b3").click(function(){
                $("div").fadeToggle(1000)
            })
        })
    </script>
</body>
</html>